package com.company.service.impl;


import com.company.dao.IAccountDao;
import com.company.service.IAccountService;

/**
 * @date : 2022/3/25 15:16
 * 服务层实现类
 */

public class AccountServiceImpl implements IAccountService {

//    private IAccountDao accountDao = new AccountDaoImpl();

    // 数据访问层接口
    private IAccountDao accountDao;

    /**
     * 通过构造方法实现依赖注入
     *
     * @param accountDao 数据访问层接口
     */
    public AccountServiceImpl(IAccountDao accountDao) {
        this.accountDao = accountDao;
    }

    /**
     * 通过setter方法进行依赖注入
     *
     * @param accountDao 数据访问层接口
     */
    public void setAccountDao(IAccountDao accountDao) {
        this.accountDao = accountDao;
    }


    @Override
    public void saveAccount() {
        accountDao.saveAccount();
    }
}
